Fibonacci
You will solve this exercise starting from the fibonacci.asm
file located in the drills/tasks/fibonacci
directory.
Calculate the Nth Fibonacci number, where N is given through the eax
register.
NOTE: The fibonacci series goes as follows :
0, 1, 1, 2, 3, ...
where each elementf[i] = f[i-2] + f[i-1]
, except for the first two elements.TIP: For example, if the value stored in
eax
is equal to5
, a correct solution will display3
and for7
, it will display8
.
If you're having difficulties solving this exercise, go through this reading material.